package activity;

import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.view.Window;
import android.view.WindowManager;

import com.lanou.horo.myapplication.R;

import cn.jpush.android.api.JPushInterface;

/**
 * Created by dllo on 15/11/23.
 */
public class FirstActivity extends Activity {

    private final  int  SPLASH_DISPLAY_LENGHT = 2000; // 延迟23秒  ;
    private SharedPreferences preferences;
    private SharedPreferences.Editor editor;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
//        requestWindowFeature(Window.FEATURE_CUSTOM_TITLE);
//        //全屏
//        getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
//                WindowManager.LayoutParams.FLAG_FULLSCREEN
//        );
        setContentView(R.layout.first);

        preferences = getSharedPreferences("phone", Context.MODE_PRIVATE);

        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent=new Intent();
                intent.setClass(FirstActivity.this,GuideActivity.class);
                FirstActivity.this.startActivity(intent);
                FirstActivity.this.finish();

            }
        },SPLASH_DISPLAY_LENGHT);
    }

    @Override
    protected void onResume() {
        super.onResume();
        JPushInterface.onResume(this);
    }

    @Override
    protected void onPause() {
        super.onPause();
        JPushInterface.onPause(this);
    }
}
